import request from '@/utils/request'

// 查询进货单列表
export function listReceipt(query) {
  return request({
    url: '/business/receipt/list',
    method: 'get',
    params: query
  })
}

// 查询进货单详细
export function getReceipt(id) {
  return request({
    url: '/business/receipt/' + id,
    method: 'get'
  })
}

// 新增进货单
export function addReceipt(data) {
  return request({
    url: '/business/receipt',
    method: 'post',
    data: data
  })
}

// 修改进货单
export function updateReceipt(data) {
  return request({
    url: '/business/receipt',
    method: 'put',
    data: data
  })
}

// 删除进货单
export function delReceipt(id) {
  return request({
    url: '/business/receipt/' + id,
    method: 'delete'
  })
}

// 根据进货单编号查询商品列表
export function getGoodsListByReceiptCode(receiptCode) {
  return request({
    url: '/business/receipt/items/' + receiptCode,
    method: 'get'
  })
}
